package adaptive.opencom;

import java.util.Calendar;
import java.util.GregorianCalendar;

/*
 * This class is used to determined with type of adaptation is required in a determined moment
 * */
public class AdaptationRequest {
	public enum AdaptationType {
		NO_ADAPTATION,
		KEYBOARD_SIZE
	}
	
	private AdaptationType type; // The adaptation request type
	private Object parameter; // The parameter of this adaptation type
	private Calendar datetime;
	
	public AdaptationRequest() {
		type = AdaptationType.NO_ADAPTATION;
		parameter = null;
		datetime = new GregorianCalendar();
	}

	public AdaptationRequest(AdaptationType type, Object parameter) {
		this.type = type;
		this.parameter = parameter;
		datetime = new GregorianCalendar();
	}
	
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append(type.toString()).append("\n").append(parameter).append("\n");
		return builder.toString();
	}

	public AdaptationType getType() {
		return type;
	}

	public void setType(AdaptationType type) {
		this.type = type;
	}

	public Object getParameter() {
		return parameter;
	}

	public void setParameter(Object parameter) {
		this.parameter = parameter;
	}

	public Calendar getDatetime() {
		return datetime;
	}

	public void setDatetime(Calendar datetime) {
		this.datetime = datetime;
	}
}
